<template>
    <Transition name="shadow">
        <div v-show="flag" class="alert">{{ text }}</div>
    </Transition>
</template>
<script>
export default ({

})
</script>
<style scoped lang="scss">
.alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.789);
    font-size: 0.4rem;
    color: #fff;
    box-sizing: content-box;
    padding: 0.7rem;
    border-radius: 0.3rem;
}

.shadow-enter-active {
    animation: shadow 0.3s linear;
}

.shadow-leave-active {
    animation: shadow 0.3s linear reverse;
}

@keyframes shadow {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}
</style>
